import { useEffect,useState } from "react";
import { View, Text, Image} from "@tarojs/components";
import './index.scss'
import { curHui, curLan, curYellow, curYgray } from "../../../../assets/files";
import { secondsToMinutes } from "../../../../common/_";
 
const ListItem = ({ item ,index}) => {

  function returnImg(index){
    if(index ===0){
      return curYellow
    }else if(index === 1){
      return curLan
    }else if(index === 2){
      return curYgray
    }

    return curHui
  }
 
  return (
    <View className="itemWrap">
      <View className="mingWrap">
        
        <Image className="curImg" src={returnImg(index)}/>
        <Text className="mingNum">{item.rankSort}</Text>
      </View>
      <View className="wxName">
        <Text className="wxNameText">{item.userName}</Text>
      </View>
      <View>
        <Text className="xueTime">{secondsToMinutes(item.watchDuration) }</Text>
      </View>
    </View>
  );
};
 
export default ListItem;